home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #1
/
Amiga Plus 1998 #1.iso
/
demo-versionen
/
haage&partner
/
warpup-warpos
/
source
/
tools
/
dbreak.p
< prev
next >
Wrap
Text File
|
1997-09-24
|
3KB
|
103 lines
incdir include:
incdir lvo:
** '(C) Copyright 1997 Haage & Partner Computer GmbH'
** All Rights Reserved
include powerpc/ppcmacros.i
include powerpc/powerpc.i
include powerpc_lib.i
include exec_lib.i
include dos_lib.i
xref _SysBase
xref _DOSBase
xref _PowerPCBase
xref _LinkerDB
smalldata
executable
escapestr
version 9
start
prolog 1024
push r31
la _d1,template
la _d2,Array
li _d3,0
RUN68K_XL _DOSBase,ReadArgs
tstw _d0
beq .close
mr r31,_d0
lw r3,Array
tstw r3
beq .clear
lbz r4,0(r3)
li r5,0
cmplwi r4,"$"
bne .loop
addi r3,r3,1
.loop
lbz r4,0(r3)
tstw r4
beq .done
slwi r5,r5,4
cmplwi r4,"0"
blt .letter
cmplwi r4,"9"
ble .number
.letter
bitclr r4,31-5
subi r4,r4,("A"-10)
b .cont
.number
subi r4,r4,"0"
.cont
add r5,r5,r4
addi r3,r3,1
b .loop
.done
sw r5,Args
li r4,HW_SETDBREAK
CALLPOWERPC SetHardware
cmplwi r3,HW_NOTAVAILABLE
beq .notavailable
la _d1,setbreak
la _d2,Args
RUN68K_XL _DOSBase,VPrintf
b .free
.clear
li r4,HW_CLEARDBREAK
CALLPOWERPC SetHardware
cmplwi r3,HW_NOTAVAILABLE
beq .notavailable
la _d1,clearbreak
la _d2,Args
RUN68K_XL _DOSBase,VPrintf
b .free
.notavailable
la _d1,notavailable
la _d2,Args
RUN68K_XL _DOSBase,VPrintf
.free
mr _d1,r31
RUN68K_XL _DOSBase,FreeArgs
.close
pop r31
epilog
section data
template dc.b "ADDRESS",0
setbreak dc.b "data breakpoint set at %08lx\n",0
clearbreak dc.b "data breakpoint cleared\n",0
notavailable dc.b "data breakpoint not available on this CPU\n",0
section bss
ds.b 32
Array ds.l 1
Address ds.l 1
Args ds.l 1
ds.b 32
even